/*
 * @Descripttion: 说明
 * @version: V1.0
 * @Author: aqiang
 * @Date: 2024-03-05 01:52:30
 * @LastEditTime: 2024-04-16 18:49:51
 */
import service from '@/utils/request'

export const useDictTypeAllApi = () => {
	return service.get('/sys/dict/type/all')
}

export const useDictTypeApi = (id: Number) => {
	return service.get('/sys/dict/type/' + id)
}

export const useDictTypeSubmitApi = (dataForm: any) => {
	if (dataForm.id) {
		return service.put('/sys/dict/type', dataForm)
	} else {
		return service.post('/sys/dict/type', dataForm)
	}
}

export const useDictDataApi = (id: Number) => {
	return service.get('/sys/dict/data/' + id)
}

export const useDictDataSubmitApi = (dataForm: any) => {
	if (dataForm.id) {
		return service.put('/sys/dict/data', dataForm)
	} else {
		return service.post('/sys/dict/data', dataForm)
	}
}
// 下拉选框列表查询
export const useSelectRelListApi = (dataForm: any) => {
	return service.get('/sys/dict/data/selectRelList', { params: dataForm })
}

//获取数据字典
export const getDataDictionary = (dataForm: any) => {
	return service.post('/sys/dict/data/getDictData', dataForm)
}
